<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="cn.company.database.Connections"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%
	int id = Integer.parseInt(request.getParameter("id"));
	String table_name = request.getParameter("table");
	String redirect_jsp = request.getParameter("redirect") != null ? request.getParameter("redirect") : table_name + ".jsp";
	Connections conns = new Connections();
	Connection conn = conns.getConnetion();
	Statement stm = conn.createStatement();
	int rs = stm.executeUpdate("delete from " + table_name + " where id = "+id+"");
	stm.close();
	conn.close();
	response.sendRedirect(redirect_jsp);
%>
